import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

const render = (Component:any) => ReactDOM.render(
  <Component />,
  document.getElementById('root') as HTMLElement
);
render(App);

// 模块热替换的 API
if ((module as any).hot) {
  (module as any).hot.accept('./App', () => {
    render(App)
  });
}

registerServiceWorker();
